﻿<%@ Page Language="C#" MasterPageFile="~/Design/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="HappyMainForm.aspx.cs" Inherits="App_System_HappyMainForm" Title="快乐管理" enableEventValidation="false" %>
<%@ Import Namespace="Shpm.App.Main.Bean" %>
<%@ Import Namespace="Shpm.App.Commons.Utils" %>
<%@ Import Namespace="Com.CodeProject.Pop3" %>
<%@ Import Namespace="System.Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script language="javascript" event="onload" for="window">
        redrawCalendarMemo();
    </script>
    <script language="javascript">
        function redrawCalendarMemo() {
            var obj = parseCalendar('CalendarMemo');
            redrawCalendar(obj);
        }
    </script>
    <table border="0" width="100%">
        <tr>
        <td width="50%" valign="top">
            <table class="table_border_line" width="100%" height="196">
                <tr>
                    <td colspan="3" align="left" valign="top" style="height:30px">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="color:#ffffff;padding-top:8px;height:30px;background-image:url('../../images/task-bar-bg.gif')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;公告栏</td>
                                <td style="height:30px;width:262px;background-image:url('../../images/task-bar.gif')"><br /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="padding-left: 0px; height:142px; line-height:21px; border-top:0px; border-bottom:0px; border-left:1px;border-right:1px; border-style:solid; border-color:#e38689" valign="top">
                        <marquee onmouseout="start()" onmouseover="stop()" height="140"  scrollamount="1" scrolldelay="30" direction="up">
                        <table id="tblNotifyMsgBoard" width="400" border="0" cellspacing="0" cellpadding="0">
                        </table>
                        </marquee>
                    </td>
                </tr>
                 <tr>
                    <td style="padding-left: 16px; border-top:0px; border-bottom:1px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689">
                        <a href="#" onclick="window.open('../Input/NotifyMessageUpdForm.aspx','NotifyMessage','scrollbars,resizable,height=520,width=480')">发送消息... </a>
                    </td>
                    <td style="padding-left: 16px; border-top:0px; border-bottom:1px; border-left:0px;border-right:0px; border-style:solid; border-color:#e38689">
                        <br />
                    </td>
                    <td align="right" style="padding-right: 16px; border-top:0px; border-bottom:1px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689">
                        <asp:LinkButton ID="LinkButton3" runat="server" PostBackUrl="~/App/Input/NotifyMessageSrhForm.aspx">更多...</asp:LinkButton>
                    </td>
                </tr>
            </table>
        </td>

        <td valign="top">
            <table class="table_border_line" width="100%" height="196"">
                <tr>
                    <td colspan="3" align="left" valign="top">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="color:#ffffff;padding-top:8px;height:30px;background-image:url('../../images/task-bar-bg.gif')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;员工信息</td>
                                <td style="height:30px;width:262px;background-image:url('../../images/task-bar.gif')"><br /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td width="1" valign="top" style="border-top:0px; border-bottom:1px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689"><img src="../../images/PHOTO.gif" height="133" width="100" /></td>
                    <td valign="top" width="100%" style="padding-left: 16px; line-height:21px; border-top:0px; border-bottom:1px; border-left:0px;border-right:0px; border-style:solid; border-color:#e38689">
                        工号: <%=this.employeeId%> <br />
                        姓名: <%=this.employeeName%> <br />
                        职务: <%=this.employeeJob %> <br />             
                        新邮件: <asp:Label ID="mails" runat="server"></asp:Label>
                    </td>
                    <td valign="middle" style="border-top:0px; border-bottom:1px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689">
                    <div id="calendar" ></div>
                    <script language="javascript"  src="../../javascript/calendar.js" type="text/javascript">
                    </script>
                    <script language="javascript">
                     function f1() {
                     var response = App_System_HappyMainForm.ServerSideAdd(100,99);
                     alert(response.value);
                     }
                    </script>
                    <script language="javascript"   type="text/javascript">
	                    var cal = new Calendar('CalendarMemo', document.getElementById('calendar'), new Date());
	                    cal.setObjectEvent(CALENDAR_CHANGE_MONTH,OnChangeMonth);
	                    cal.setObjectEvent(CALENDAR_CLICK_DATE,OnClickDate);
	                    cal.setObjectEvent(CALENDAR_CLICK_HEADER,OnClickHeader);
	                    cal.setObjectEvent(CALENDAR_CLICK_WEEK,OnClickWeek);
                    </script>
                    </td>
                </tr>
            </table>
        </td>
        </tr>
    </table>
    
    <table width="100%">
    <tr>
    <td style="width:50%" valign="top">
        <table class="table_border_line" width="100%" height="194">
            <tr>
                <td colspan="2" align="left">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="color:#ffffff;padding-top:8px;height:30px;background-image:url('../../images/task-bar-bg.gif')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;销售资料</td>
                            <td style="height:30px;width:262px;background-image:url('../../images/task-bar.gif')"><br /></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="padding-left: 16px;line-height:21px; padding-top:6px; border-top:0px; border-bottom:0px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689" height="100%" valign="top">                           
                    <asp:LinkButton ID="lnkButton1" runat="server" Text="快乐活动查询" PostBackUrl="~/App/Input/HappyPlanSrhForm.aspx" /><br />
                    
                    <asp:LinkButton ID="lnkButton2" runat="server" Text="会员兴趣查询" PostBackUrl="~/App/Input/HappyClubInterestSrhForm.aspx" /><br />
                    
                    <asp:LinkButton ID="lnkButton3" runat="server" Text="亲和俱乐部查询" PostBackUrl="~/App/Input/HappyClubSrhForm.aspx" /><br />
                    <%--<asp:LinkButton ID="lnkButton2" runat="server" Text="房态信息" PostBackUrl="~/App/Search/RoomStatusSrhForm.aspx" /><br />
                    <asp:LinkButton ID="lnkButton3" runat="server" Text="资料查询" PostBackUrl="~/App/Search/SaleSrhForm.aspx" /><br />
                    
                    <asp:LinkButton ID="LinkButton2" runat="server" Text="物资管理" PostBackUrl="~/App/Master/MaterialUpdForm.aspx" /><br />
                    <asp:LinkButton ID="LinkButton3" runat="server" Text="物资申领" PostBackUrl="~/App/Master/MaterialRequisitionForm.aspx" /><br />
                    --%>
                    <!--
                    ■<a href="../Master/DocContractSrhForm.aspx">销售资料维护</a><br />
                    ■<a href="../Input/SaleProcessBeginForm.aspx">销售过程登记</a><br />
                    ■<a href="../Master/PersonInfoSrh.aspx">入会登记</a><br />
                    ■<a href="../Input/ContractSrhForm.aspx">合同登记</a><br />
                    ■<a href="../Input/RoomBookSrhForm.aspx">入住登记</a><br />                           
                    -->
                </td>    
                <td style="padding-left: 16px;line-height:21px; padding-top:6px; border-top:0px; border-bottom:0px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689" height="100%" valign="top">   
                    <!--
                    ■<a href="../Master/RoomInfoMaintanceForm.aspx">房间信息维护</a><br />
                    ■<a href="../Search/SaleSrhForm.aspx">销售资料查询</a><br />
                    
                    ■<a href="../Search/SaleAchievementSrhForm.aspx">员工业绩查询</a><br />
                    ■<a href="../Search/SaleProcSrhForm.aspx">销售过程查询</a><br />
                    -->
                </td>                         
            </tr>  
            <tr><td colspan="2" height="32" style="border-top:0px; border-bottom:1px; border-left:1px;border-right:1px; border-style:solid; border-color:#e38689"></td></tr>                 
        </table>
    </td>
    <td style="" valign="top" height="194">
        <table class="table_border_line" width="100%" height="100%">
                <tr>
                    <td colspan="3" align="left">
                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="color:#ffffff;padding-top:8px;height:30px;background-image:url('../../images/task-bar-bg.gif')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;个人待办</td>
                                    <td style="height:30px;width:262px;background-image:url('../../images/task-bar.gif')"><br /></td>
                                </tr>
                            </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="padding-left: 16px; height:142px; line-height:21px; border-top:0px; border-bottom:0px; border-left:1px;border-right:1px; border-style:solid; border-color:#e38689" valign="top">
                        <div id="msgBoard" style="font-family: 宋体">
                            <table id="tblMsgBoard">                            
                            </table>
                        </div></td>
                </tr>
               <tr style="font-family: 宋体">
                    <td style="padding-left: 16px; border-top:0px; border-bottom:1px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689">
                        <asp:LinkButton ID="LinkButton14" runat="server" Text="物资申领" PostBackUrl="~/App/Master/MaterialRequisitionForm.aspx" />｜
                        <asp:LinkButton ID="LinkButton15" runat="server" Text="物资审批" PostBackUrl="~/App/Input/MaterialApproveForm.aspx" />｜
                        <asp:LinkButton ID="LinkButton18" runat="server" Text="物资管理" PostBackUrl="~/App/Master/MaterialUpdForm.aspx" />｜
                        <asp:LinkButton ID="LinkButton2" runat="server" Text="请假单信息" PostBackUrl="~/App/Input/PersonLeaveSrhForm.aspx" />｜
                        <a href="#" onclick="window.open('../Input/MessageUpdForm.aspx','PrivateMessage','scrollbars,resizable,height=550px,width=550px')">发送消息... </a>
                    </td>
                    <td style="border-top:0px; border-bottom:1px; border-left:0px;border-right:0px; border-style:solid; border-color:#e38689">
                        <br />
                    </td>
                    <td align="right" style="padding-right: 16px; border-top:0px; border-bottom:1px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689">
                        <asp:LinkButton ID="LinkButton1" runat="server" Text="更多..." PostBackUrl="~/App/Input/MessageSrhForm.aspx" />
                    </td>
              </tr>
            </table>    
    </td>
    </tr>
    </table>
    
    <table width="100%" border="0">
        <tr>
            <td width="100%" valign="top">
                <table class="table_border_line" border="0" width="100%">
                    <tr>
                        <td align="left" colspan="7">
                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="color:#ffffff;padding-top:8px;height:30px;background-image:url('../../images/task-bar-bg.gif')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;工作区</td>
                                    <td style="height:30px;width:262px;background-image:url('../../images/task-bar.gif')"><br /></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;<!-- table width="90%" border="1" class="table_border_line">
                            <tr>
                                <td class="list_data_bg">员工编号</td>
                                <td class="list_data_bg">联系人</td>
                                <td class="list_data_bg">意向程度</td>
                                <td class="list_data_bg">销售状态</td>
                                <td class="list_data_bg">回访时间</td>
                            </tr>
                            <tr>
                                <td>6102</td>
                                <td>XXX</td>
                                <td>★★★★★</td>
                                <td>合同签订</td>
                                <td>2007/01/01</td>
                            </tr>
                            <tr>
                                <td>6102</td>
                                <td>XXX</td>
                                <td>★★★★★</td>
                                <td>合同签订</td>
                                <td>2007/01/01</td>
                            </tr>
                            <tr>
                                <td>6102</td>
                                <td>XXX</td>
                                <td>★★★★★</td>
                                <td>合同签订</td>
                                <td>2007/01/01</td>
                            </tr>
                            <tr>
                                <td colspan="5" align="right">更多...</td>
                            </tr>
                        </table --></td>
                    </tr>
                </table>                
            </td>

            <!-- td colspan="2" valign="top">               
                <table class="table_border_line">
                    <tr>
                        <td align="left" class="list_title_blue_bg">&nbsp;考勤记录</td>
                    </tr>
                    <tr>
                        <td>
                        <table width="90%" border="1" class="table_border_line">
                            <tr>
                                <td class="TD_headrow_style" height="25">员工编号</td>
                                <td class="TD_headrow_style">员工姓名</td>
                                <td class="TD_headrow_style">出勤时间</td>
                                <td class="TD_headrow_style">退席时间</td>
                            </tr>
                            <tr>
                                <td height="16" class="TD_row_style">6102</td>
                                <td class="TD_row_style">XXX</td>
                                <td class="TD_row_style">09:00</td>
                                <td class="TD_row_style">17:00</td>
                            </tr>
                            <tr>
                                <td height="16" class="TD_row_style">6104</td>
                                <td style="height: 18px" class="TD_row_style">XXX</td>
                                <td style="height: 18px" class="TD_row_style">09:00</td>
                                <td style="height: 18px" class="TD_row_style"> -- </td>
                            </tr>
                            <tr>
                                <td height="16" class="TD_row_style">6104</td>
                                <td class="TD_row_style">XXX</td>
                                <td class="TD_row_style"> -- </td>
                                <td class="TD_row_style"> -- </td>
                            </tr>
                            <tr>
                                <td colspan="4" align="right" class="TD_row_style">更多...</td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                </table>
            </td -->
        </tr>
    </table>
    
    <script language="javascript" type="text/javascript">
        // set time frequency to get new message from sever
        function getNotifyMessage() {
            var e;            
            try {
                CommonAjaxUtils.GetNotifyMessage('<%=this.employeeId %>', '<%=this.userId %>',bindCallBackResult_NotifyMessage);
		    }
            catch(e) {
                alert(e.message);
            }
        }
                
        function bindCallBackResult_NotifyMessage(response) {    
            try {                                            
                setTimeout("getNotifyMessage()", <%=refreshMsgMSeconds %>);            
                                          
                var targetData = response.value;               		    		        		        		        
	            var msgTable;
	            msgTable = document.getElementById("tblNotifyMsgBoard");
    	        
    	        // refresh work area message board
	            if (msgTable != null && typeof(msgTable) == "object"){
                    bindMsgTable(msgTable,targetData);
	            }
	        }
            catch(e) {
                alert(e.message);
            }
        }
        
        // bind message table data
        function bindMsgTable(objTable,objData) { 
            if (objData == null) { return; }
                  									
		    // del rows                        
		    for(var i=objTable.rows.length - 1; i >= 0; i--) {				
			    objTable.deleteRow(i);				
		    }
		    
		    // readd rows
		    var maxDispCnt = objData.length > <%=msgMaxDispCount %> ? <%=msgMaxDispCount %> : objData.length;
            for(var i = 0; i < maxDispCnt; i++) {                      
                var id = objData[i].MessageId;                
                var sendDate = objData[i].SendDate.format(GLOBAL_CALENDAR_DATE_FORMAT);
                var title = objData[i].Subject;
                var origin = objData[i].DepartName;
                var status = objData[i].MessageStatus;
                if (title == null) {
                    title = "(无主题)";
                }
                
                var elementRow = objTable.insertRow(objTable.rows.length);
		        elementRow.id = "msgRow" + i;
		        
                var elementCol = elementRow.insertCell(elementRow.cells.length);
                elementCol.align = "left";
                elementCol.className = "TD_row_style_message"; 
                if (status == "1") {
                    elementCol.className = "TD_row_style_new_message";                
                }
                //elementCol.innerHTML = "<A href=\"" + strCmd + "\" >" + name +"</A>";
                var elementLink = top.window.mainFrame.document.createElement("A");
                elementLink.setAttribute("id", "msgLink" + i);                
                elementLink.setAttribute("href", "javascript:top.window.topFrame.getNewMessage();window.open('../Input/MessageReadForm.aspx?MESSAGE_ID=" + id +"','_blank','scrollbars,resizable,height=550,width=520');void(0);");
                elementLink.setAttribute("innerText", sendDate + "  " + origin + "：" + title); 
                //elementLink.setAttribute("style", "color:red");
                elementCol.appendChild(elementLink);
            }
        }               
    </script>
</asp:Content>

